package com.zoe.study.config;

import com.zoe.study.entity.Author;
import com.zoe.study.entity.Book;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author Zoe.Zhang
 * @Date: 2021/09/12
 * @Description 加上@configuration注解后,会被ConfigurationClassPostProcessor所代理增强;做一些增强操作
 * 如果被@Component所标识则不会
 *
 * https://blog.csdn.net/isea533/article/details/78072133
 */
@Configuration
public class MyConfig {
    @Bean
    Author author() {
        return new Author();
    }

    @Bean
    Book book() {
        return new Book(author());
    }
}
